#ifndef container_adapter_HPP__
#define container_adapter_HPP__

#include "ranges.hpp"
#include "category_adapter.hpp"
#include "helpers.hpp"




//TODO: all must be a member of the container.

template <typename Container>
ToRange<typename Container::iterator> all( Container const & cont )
{
	typedef typename Container::pointer pointer;

	pointer begin_ptr = const_cast<pointer>( get_pointer( cont.begin() ) );
	pointer end_ptr = const_cast<pointer>( get_pointer( cont.end() ) );

	return ToRange<typename Container::iterator>( begin_ptr, end_ptr );
}

template <typename Container>
ToRange<typename Container::iterator> all( Container & cont )
{
	typedef typename Container::pointer pointer;

	pointer begin_ptr = get_pointer( cont.begin() );
	pointer end_ptr = get_pointer( cont.end() );

	return ToRange<typename Container::iterator>( begin_ptr, end_ptr );
}

template< class T, size_t N >
random_access_range<T> all( T (&array)[N] )
{
	return input_range<T>( array, array+N );
}


//template< class C >
//auto begin( C& c ) -> decltype(c.begin());
//(1) 	(since C++11)
//	template< class C >
//auto begin( const C& c ) -> decltype(c.begin());
//(2) 	(since C++11)
//	
//T* begin( T (&array)[N] );



#endif // container_adapter_HPP__